package boot

import (
	"fmt"
	"gitee.com/worklz/dtm-tcc-demo/server-order/pkg/global"
	"time"

	"gitee.com/worklz/dtm-tcc-demo/common/config"
	"gitee.com/worklz/dtm-tcc-demo/common/log"
	orderconfig "gitee.com/worklz/dtm-tcc-demo/server-order/config"
)

// 启动处理
func init() {
	// 设置时区
	timelocal, err := time.LoadLocation("Asia/Shanghai")
	if err != nil {
		panic(fmt.Errorf("时区设置错误！%v", err))
	}
	time.Local = timelocal
	// 初始化日志
	log.InitLogger()
	// 初始化配置
	global.Config = &orderconfig.Config{}
	config.InitConfig(global.Config)
}
